package com.feng.zhihao.apigeteway.gateway.bean.impl.INTERFACE_FIELD_POSITION.REQ;

import org.springframework.stereotype.Component;

import com.feng.zhihao.apigeteway.entity.InterfaceFieldInfo;
import com.feng.zhihao.apigeteway.gateway.ReqContext;
import com.feng.zhihao.apigeteway.gateway.bean.INTERFACE_FIELD_POSITION_REQ;

@Component("FIELD_POSITION_REQ_URL_PATH")
public class FIELD_POSITION_REQ_URL_PATH implements INTERFACE_FIELD_POSITION_REQ {

	@Override
	public String getValue(InterfaceFieldInfo interfaceFieldInfo, ReqContext reqContext) {
		return reqContext.getUrlParams()[Integer.parseInt(interfaceFieldInfo.getInterfaceFieldFormatting())];
	}

}
